<template>
   <el-container>
    <el-header>   
    <el-input  v-model="input" placeholder="请输入身份证号码" class="input"></el-input>
    <el-input type="password" v-model="password" placeholder="请输入密码" class="input"></el-input>
    <el-button type="primary" icon="el-icon-search" @click="searchRes">提交</el-button>
    </el-header>    
</el-container>
</template>

<script>
    export default {
        data(){
            return{
                input:"",
                password:""
            }
        },
        methods:{
            searchRes(){
                let url="/admin/changePassword"
                let formData=new FormData();
                formData.append("personNumber",this.input)
                formData.append("newPwd",this.password)
                this.axios.post(url,formData,{
                    headers:this.$store.state.headers
                }).then(res=>{
                    if(res.data.status==0){
                        this.$message({
                        message: '上传成功',
                        type: 'success'
                    })
                    }else{
                        this.$message(res.data.msg)
                    }
                },err=>{
                    this.$message(err.data.msg)
                })
            }
        }
    }
</script>

<style scoped>
    .input{
        display: inline-block;
        width: 20%
    }
</style>